import { Expose, Transform } from "class-transformer";

export class UserBaseVo {
    @Expose()
    @Transform(({ value }: { value: number }) => String(value))
    id!: string;

    @Expose()
    username!: string;

    @Expose()
    nickname!: string;

    @Expose()
    avatar?: string;

    @Expose()
    phone?: string;

    @Expose()
    sex!: string;

    @Expose()
    roles!: string[];

    @Expose({ name: "dept_id" })
    deptId!: string;

    @Expose()
    accessToken!: string;

    @Expose()
    refreshToken!: string;

    @Expose()
    expires!: number; // 过期时间戳, 毫秒

    @Expose({ name: "created_by" })
    createdBy!: string;

    @Expose({ name: "updated_by" })
    updatedBy!: string;

    @Expose({ name: "created_at" })
    createdAt!: Date;

    @Expose({ name: "updated_at" })
    updatedAt!: Date;
}
